#include<stdio.h>
int SB(int n);

int main() {
    int n;
    do {

        scanf_s("%d", &n);
    } while (!(n >= 5 && n <= 20));

    printf("Total donation schemes: %d\n", SB(n));
    return 0;
}

int SB(int n) {
    int count = 0;


    for (int x = n; x <= (160000 - 8000 * n) / 5000; x++) {
        for (int y = n; y <= (160000 - 8000 * n) / 2000; y++) {
            for (int z = n; z <= (160000 - 8000 * n) / 1000; z++) {
                if ((5000 * x + 2000 * y + 1000 * z == 160000) && (x + y + z >= 3 * n)) {
                    printf("x=%d,y=%d,z=%d\n",x,y,z);
                    count++;
                }
            }
        }
    }
    return count;
}